.TH std::shared_future::get 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::shared_future::get \- std::shared_future::get

.SH Synopsis
   Main template
   const T& get() const;                   \fB(1)\fP \fI(since C++11)\fP
   std::shared_future<T&> specializations
   T& get() const;                         \fB(2)\fP \fI(since C++11)\fP
   std::shared_future<void> specialization
   void get() const;                       \fB(3)\fP \fI(since C++11)\fP

   The get member function waits (by calling wait()) until the shared state is ready,
   then retrieves the value stored in the shared state (if any).

   If valid() is false before the call to this function, the behavior is undefined.

.SH Return value

   1) A const reference to the value stored in the shared state. The behavior of
   accessing the value through this reference after the shared state has been destroyed
   is undefined.
   2) The reference stored as value in the shared state.
   3) \fI(none)\fP

.SH Exceptions

   If an exception was stored in the shared state referenced by the future (e.g. via a
   call to std::promise::set_exception()) then that exception will be thrown.

.SH Notes

   The C++ standard recommends the implementations to detect the case when valid() is
   false before the call and throw a std::future_error with an error condition of
   std::future_errc::no_state.

.SH Example

    This section is incomplete
    Reason: no example

.SH See also

   valid checks if the future has a shared state
         \fI(public member function)\fP

.SH Category:
     * Todo no example
